public class LogIn {
    private String userName = "admin";
    private String passWord = "123456";

    public void loginInfo(String username, String password) {
        try {
            if(!this.userName.equals(username)) {
                throw new UserNameErroException();
                //System.out.println("用户名错误！");
                //return;
            }
            if(!this.passWord.equals(password)) {
                throw new PasswordErroException();
                //System.out.println("密码错误！");
                //return;
            }
            System.out.println("登陆成功");
        } catch(UserNameErroException e) {
            e.printStackTrace();
        } catch(PasswordErroException e) {
            e.printStackTrace();
        }

        System.out.println("登陆成功");
    }

    public static void main(String[] args) {
        LogIn login = new LogIn();
        login.loginInfo("admin2", "123456");


    }
}
